package com.java复习.demo2;

public class Cat {

    // 数据保护加上private
    private String name;
    private int age;

    //授权访问
    public void setAge(int age){
        this.age=age;

    }

    //用于读取
    public int getAge(){
        return this.age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
